package com.catclay.adultmoon.config;

//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

//@EnableWebSecurity
public class AmSecurityConfig  {
//public class AmSecurityConfig extends WebSecurityConfigurerAdapter {
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//
//        //首页所有人可以访问，功能页对应权限人员访问
//        //授权
//        http.authorizeRequests().antMatchers("/").permitAll()
//                .antMatchers("/order/**").permitAll();
//
//        //无权限跳转到登录页
//        // /login
//        http.formLogin();
//
//        //注销，开启注销功能，
//        http.logout().logoutSuccessUrl("/");
//    }
//
//    //认证
//    //密码加密BCryptPasswordEncoder
//    //内存添加登录用户
////    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        auth.inMemoryAuthentication().passwordEncoder(new BCryptPasswordEncoder())
//                .withUser("admin").password(new BCryptPasswordEncoder().encode("am123456")).roles("admin");
//    }
}
